package org.jeecg.modules.app.enums;

import org.jeecg.common.annotation.EnumDict;
import org.jeecg.common.enums.IEnumDict;
import org.jeecg.common.exception.JeecgBootException;

@EnumDict(code ="app_type_dict", name = "应用类型")
public enum AppTypeEnums implements IEnumDict<AppTypeEnums> {

    APP("1", "APP", "App", "enums.apptype.app"),

    MP("2", "小程序", "Mp", "enums.apptype.mp"),

    H5("3", "H5", "H5", "enums.apptype.h5");

    private String value;

    private String label;

    private String key;

    /**
     * 多语言key
     */
    private String remark;

    AppTypeEnums(String value, String label, String key, String remark) {
        this.value = value;
        this.label = label;
        this.key = key;
        this.remark = remark;
    }

    @Override
    public String getValue() {
        return value;
    }

    @Override
    public String getLabel() {
        return label;
    }

    @Override
    public String getKey() {
        return key;
    }

    public String getRemark() {
        return remark;
    }

    public static AppTypeEnums getEnumByValue(String value){
        for(AppTypeEnums item: values()){
            if(value.equals(item.value)){
                return item;
            }
        }
        throw new JeecgBootException("没找到对应字典");
    }

}
